import {sendActionGet} from '../../utils/axios'

const Album={
    state:{
        albums:[{
            id:"",
            name:"",
            encrypted:"",
            cover:""
        }]
    },
    reducers:{
        getList(state,payload){
            return{
                ...state,
                albums:payload
            }
        }
    },
    effects:{
        async getListAsync(payload,rootState){
            const res =await sendActionGet('/api/v1/album/list')
            this.getList(res.data.albums)
            return res.data.albums
        }
    }
}

export default Album;